package Lono::Recipe;

use strict;
use warnings;

our $VERSION = '0.0.1';

=head1 NAME

Lono::Recipe - Representation of a recipe.

=head1 SYNOPSIS

  use Lono::Recipe::Builder;

  my $builder = Lono::Recipe::Builder->new;
  $builder->set_name( 'Burrito' );
  $builder->add_ingredient( '3 cups shredded cheese' );
  
  ...
 
  my $recipe = $builder->build_recipe;

  my $name = $recipe->get_name;
  my @ingredients = $recipe->get_ingredients; 

  print $recipe->as_xml;

=head1 DESCRIPTION

This class models a recipe.  If you plan to create a recipe, you are urged
to use Lono::Recipe::Builder.  It provides the support for safely buildling 
Recipe objects.

"A Perl module would prefer that you stay out of its living room because
you weren't invited, not because it has a shotgun."
    - Programming Perl

=cut 

use base qw( Class::Accessor );

__PACKAGE__->follow_best_practice;

our @RECIPE_FIELDS = qw( name ingredients 
                         yield_amount yield_unit 
                         total_time active_time 
                         preparation description 
                         nutrition source url );

Lono::Recipe->mk_accessors( @RECIPE_FIELDS );

=head1 FUNCTIONS

=over 4

=item get_name()

The recipe's name/title.

=item get_description()

An introduction, explaining the recipe.

=item get_ingredients()

A list of Lono::Recipe::Ingredient objects, each representing one ingredient.

=item get_preparation()

The preparation steps for the recipe.

=item get_yield_unit()

The type of yield produced by the recipe (i.e.: servings, bars, etc).

=item get_yield_amount()

The number of items produced by the recipe.

=item get_total_time()

The amount of elasped time required for the recipe, from start to finish.

=item get_active_time()

The amount of time required for preparing and tending to the recipe.

=item get_nutrition()

Nutrition information about the recipe.

=item get_source()

The source publication or website.

=item get_url()

If scraped from the web, the origin url.

=item recipe_fields()

Returns the list of fields that comprise a recipe.

=cut

sub recipe_fields {
    return @RECIPE_FIELDS;
}

=back

=cut

1;
